// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   query_from_time.java

package include.query;


public class query_from_time
{

	private String sql;
	private String timea;
	private String timeb;

	public query_from_time()
	{
		sql = "";
		timea = "";
		timeb = "";
	}

	public String query_from_time(String timea, String timeb)
	{
		this.timea = timea;
		this.timeb = timeb;
		if (!timea.equals(""))
			timea = (new StringBuilder(String.valueOf(timea))).append(" 00:00:00").toString();
		if (!timeb.equals(""))
			timeb = (new StringBuilder(String.valueOf(timeb))).append(" 23:59:59").toString();
		if (!timea.equals("") && timeb.equals(""))
			sql = (new StringBuilder("select distinct static_report_ID,register,static_report_time from stock_balance_static_report where static_report_time>='")).append(timea).append("' order by static_report_time desc").toString();
		else
		if (!timea.equals("") && !timeb.equals(""))
			sql = (new StringBuilder("select distinct static_report_ID,register,static_report_time from stock_balance_static_report where static_report_time>='")).append(timea).append("' and static_report_time<='").append(timeb).append("' order by static_report_time desc").toString();
		else
		if (timea.equals("") && !timeb.equals(""))
			sql = (new StringBuilder("select distinct static_report_ID,register,static_report_time from stock_balance_static_report where static_report_time<='")).append(timeb).append("' order by static_report_time desc").toString();
		else
		if (timea.equals("") && timeb.equals(""))
			sql = "select distinct static_report_ID,register,static_report_time from stock_balance_static_report order by static_report_time desc";
		return sql;
	}
}
